home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / OpenDoc Utilities / Interfaces / EditrSet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  2.8 KB  |  126 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        EditrSet.h
  3.  
  4.     Contains:    Class definition for EditerSet and ODEditerSetIterator
  5.  
  6.     Owned by:    Reggie Adkins
  7.  
  8.     Copyright:    © 1993-1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     12/9/96    EL        1602726: Add private FindEditor method.
  13.  
  14.     To Do:
  15. */
  16.  
  17. #ifndef _EDITRSET_
  18. #define _EDITRSET_
  19.  
  20. #ifndef _PLFMDEF_
  21. #include "PlfmDef.h"
  22. #endif
  23.  
  24. #ifndef _ODOBJ_
  25. #include "ODObject.xh"
  26. #endif
  27.  
  28. #ifndef _ODTYPES_
  29. #include "ODTypes.h"
  30. #endif
  31.  
  32.  
  33. //=====================================================================================
  34. // Classes used by this interface
  35. //=====================================================================================
  36.  
  37. class EditorSetIterator ;
  38. class OrderedCollection;
  39. class OrderedCollectionIterator;
  40.  
  41. //=====================================================================================
  42. // Class EditorSet
  43. //=====================================================================================
  44.  
  45. class EditorSet
  46. {
  47.     
  48. public:
  49.  
  50.     EditorSet();
  51.     void InitEditorSet();
  52.     virtual ~EditorSet();
  53.  
  54.     ODMethod void AddEditor(ODEditor editor);
  55.     
  56.         // Adds an type to the end of the set, creating a copy of the argument in the set.
  57.  
  58.     ODMethod void AddEditorSet(EditorSet* editors);
  59.     
  60.         // Unions the two into this (leaving the argument unchanged).
  61.  
  62.     ODMethod void RemoveEditor(ODEditor editor);
  63.     
  64.         // Removes an editor from a set.  Does nothing if the argument editor is not present.
  65.     
  66.     ODMethod void RemoveEditor( EditorSet* editors );
  67.     
  68.         // Removes all editors present in the argument set.
  69.  
  70.     ODMethod void RemoveAllEditors();
  71.     
  72.         // Removes all editors from the set.
  73.  
  74.     ODMethod ODBoolean ContainsEditor(ODEditor editor);
  75.     
  76.         // Returns true if the set contains the specified editor.
  77.         // Otherwise, returns false.
  78.  
  79.     ODMethod ODULong GetEditorCount();
  80.         
  81.     ODMethod EditorSetIterator* CreateIterator();
  82.     
  83.         // Returns an iterator for the set, which can be used to retrieve editors
  84.         // from the set in order.
  85.  
  86. private:
  87.  
  88.     OrderedCollection*    fSet;
  89.  
  90.     Environment*    fEv;
  91.  
  92.     friend class EditorSetIterator;
  93.     
  94.     ODMethod ODEditor FindEditor(ODEditor editor);
  95.  
  96.     // Returns true if the set contains the specified editor.
  97.     // Otherwise, returns false.
  98. };
  99.     
  100. //=====================================================================================
  101. // Class EditorSetIterator
  102. //=====================================================================================
  103.  
  104. class EditorSetIterator
  105. {
  106.     
  107.  
  108.     public:
  109.         EditorSetIterator(EditorSet* set);
  110.         virtual ~EditorSetIterator();
  111.  
  112.         ODVMethod ODEditor    First();
  113.         ODVMethod ODEditor    Next();
  114.         ODVMethod ODBoolean    IsNotComplete();
  115.         
  116.             // These methods return a pointer to a string within the set.
  117.             // The client must not dispose this memory, and must be aware that
  118.             // These methods return nil if the requested item does not exist.
  119.         
  120.     private:
  121.         OrderedCollectionIterator*    fIterator;
  122. };
  123.  
  124.  
  125. #endif
  126.